
<style scoped>
.layout{
    border: 1px solid #d7dde4;
    background: #f5f7f9;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}
.layout-logo{
    width: 100px;
    height: 30px;
    
    border-radius: 3px;
    float: left;
    position: relative;
    top: 15px;
    left: 20px;
}
.layout-nav{
    width: 420px;
    margin: 0 auto;
    margin-right: 20px;
}
.layout-footer-center{
    text-align: center;
}
</style>
<template>
    <div class="layout">
        <Layout>
            <Header>
                <Menu mode="horizontal" theme="dark" active-name="1">
                    <div class="layout-logo">
                       享堂后台管理
                    </div>
                    <div class="layout-nav">
                        <MenuItem name="3">
                            <Icon type="ios-analytics"></Icon>
                            用户名：{{ name }}
                        </MenuItem>
                        <MenuItem name="4"  @click.native="logout">
                            <Icon type="ios-paper"></Icon>
                            登出系统
                        </MenuItem>
                    </div>
                </Menu>
            </Header>
            <Layout :style="{padding: '0 0px'}">
                <Content :style="{padding: '24px 0', minHeight: '100%' , background: '#fff'}">
                    <Layout>
                        <Sider hide-trigger :style="{background: '#fff'}">
                            <Menu active-name="1-2" theme="light" width="auto" :open-names="['1']">
                                <Submenu name="1">
                                    <template slot="title">
                                        <Icon type="ios-navigate"></Icon>
                                        商品管理
                                    </template>
                                    <MenuItem name="1-1" @click.native="f('/index/marketcommoditylist')">享堂集市</MenuItem>
                                    <MenuItem name="1-2" @click.native="f('/index/collegecommoditylist')">享堂书院</MenuItem>
                                    <MenuItem name="1-3" @click.native="f('/index/academycommoditylist')">享堂学院</MenuItem>
                                </Submenu>
                                <Submenu name="2"> 
                                    <template slot="title">
                                        <Icon type="ios-keypad"></Icon>
                                        用户管理
                                    </template>
                                    <MenuItem name="2-1" @click.native="f('/index/userlist')">用户列表</MenuItem>
                                    <MenuItem name="2-2" @click.native="f('/index/studentlist')">学生认证</MenuItem>
                                </Submenu>
                                <Submenu name="3">
                                    <template slot="title">
                                        <Icon type="ios-keypad"></Icon>
                                        订单管理
                                    </template>
                                    <MenuItem name="3-1" @click.native="f('/index/orderlist')">订单列表</MenuItem>
                                </Submenu>
                                <Submenu name="5">
                                    <template slot="title">
                                        <Icon type="ios-keypad"></Icon>
                                        学校管理
                                    </template>
                                    <MenuItem name="5-1" @click.native="f('/index/schoolList')">学校列表</MenuItem>
                                </Submenu>
                                <Submenu name="4">
                                    <template slot="title">
                                        <Icon type="ios-analytics"></Icon>
                                        系统设置
                                    </template>
                                    <MenuItem name="4-1" @click.native="f('/index/advertisement')">小程序主页广告栏</MenuItem>
                                    <MenuItem name="4-2" @click.native="f('/index/editproperty')">第三方服务配置</MenuItem>
                                    <MenuItem name="4-3" @click.native="f('/index/editcategory')">商品类别配置</MenuItem>
                                    <MenuItem name="4-4" @click.native="f('/index/helplist')">小程序问答配置</MenuItem>
                                    <MenuItem name="4-5" @click.native="f('/index/editbeanproperty')">系统配置</MenuItem>
                                </Submenu>
                                
                            </Menu>
                        </Sider>
                        <Content :style="{padding: '24px', minHeight: '280px', background: '#fff'}">
                           <div>
                               
                                     <router-view></router-view>
                                 
                           </div>
                        </Content>
                    </Layout>
                </Content>
            </Layout>
            <Footer class="layout-footer-center">2003-2018 &copy; 八阵图</Footer>
        </Layout>
    </div>
</div>
</template>
<script>

    export default {  

        created() {
            if (sessionStorage.getItem("admin") == null) {
                this.$router.push("/");
                return;
            }
            this.name = sessionStorage.getItem("admin");
        },

        data() {
            return {
                name : ''
            }
        },

        methods:{
            logout() {
                sessionStorage.clear();
                this.$router.push("/");
            },
            f(x) {
                this.$router.push(x);
            }
        }

    }
</script>
